<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>jd隐藏蓝</title>
    <style>
        .box
        {
            /* background-color: #000; */
            display: flex;
            /* align-items: center; */
            justify-content: space-between;
            /* text-align: center; */
            background-color: #000;
            width: 300px;
            height: 50px;
            color: #fff;
            padding-left: 10px;
            font-size: 12px;
            overflow: hidden;
            
            /* vertical-align:middle; */
            transition: all .3s ease-out;
        }

        .icon
        {
            display: flex;
            justify-content: space-between;
            align-items: center;
            width: 45px;
            font-size: 16px;
        }

        

        .icon img
        {
           width: 24px;
           height: 24px;
        }

        .icon .deleteIcon
        {
            cursor: pointer;
            margin-right:10px ;
        }


        .info
        {
            align-self: center;
            width: 200px;
            margin-left: 20px;
        }
        
        .option
        {
            /* display: inline-block; */
           display: flex;
           align-items: center;
           justify-content: center;
           background-color: red;
           width: 100px;
           
           
        }
    </style>
</head>
<body>

    <div class="box">
        <div class="icon">
            <span class="deleteIcon">x</span>
        <img src="./image/京东.png" alt="">
        </div>
        <div class="info">
            <span class="title">打开京东App，购物更轻松</span>
        </div>
        <div class="option">
            立即打开
        </div>

    </div>

    <script>
        var boxEl = document.querySelector(".box");
        console.log(boxEl);
        var deleteEl = document.querySelector(".deleteIcon") ;
        console.log(deleteEl);
        deleteEl.onclick = function()
        {
           boxEl.style.height = 0;
        //    boxEl.remove();
        }

        boxEl.ontransitionend = function()
        {
            boxEl.remove();
        }
        
    </script>
    
</body>
</html>